const init = function () {
  const _this = this;
  // 建议为了方便使用，这里可以包装window.Alert
  window.Alert = function (msg, duration = 3000) {
    // _this.$message({
    //   showClose: true,
    //   message: msg,
    //   type: 'error',
    //   duration
    // })
    _this.$notify({
      title: '错误',
      message: msg,
      type: 'error',
      customClass: 'el-error-msg',
      duration
    });
  }

  window.Tips = function (msg, duration = 3000) {
    _this.$notify({
      title: '成功',
      message: msg,
      type: 'success',
      duration
    });
  }

  window.Warning = function (msg, duration = 3000) {
    _this.$notify({
      title: '警告',
      message: msg,
      type: 'warning',
      duration
    });
  }
};

export default {
  init
}
